package com.aptemo.webetek.server.handlers;

import com.aptemo.webetek.client.commands.Action;
import com.aptemo.webetek.client.commands.impl.GetUserInfoAction;
import com.aptemo.webetek.client.exceptions.BackendException;
import com.aptemo.webetek.client.exceptions.WebetekLoginException;
import com.aptemo.webetek.server.datastore.DataStoreAPI;
import com.aptemo.webetek.shared.UserBean;

public class UserDetailsHandler
		extends ActionHandler<GetUserInfoAction, UserBean>
{

	public UserDetailsHandler(DataStoreAPI service)
	{
		super(service);
	}

	@Override
	public Class<? extends Action<?>> getActionType()
	{
		return GetUserInfoAction.class;
	}

	@Override
	public UserBean invoke(GetUserInfoAction action) throws BackendException, WebetekLoginException
	{
		// UserBean userinfo = mparent.getPlayerDetails(action.getUserid());
		return dataService.getPlayer(action.getUserid());
	}
}
